#include "aerial\MainMenuScene.h"

#include "aerial\CreateScene.h"

#include "aerial\Object\Button.h"
#include "aerial\Object\Panel.h"

#include "aerial\Scene\Event.h"
#include "aerial\Core\Core.h"

bool MainMenuScene::initialize()
{
	
	Panel* menu = new Panel(hgeResMan, 0, 0, 250, 600);
	menu->placeGuiObjectOffset(
		new Button(hgeResMan, 0.2f, "Create Game",
			new SEvent<MainMenuScene>(this, &MainMenuScene::hint)
		), 
		40.0f, 120.0f);
	menu->placeGuiObjectOffset(
		new Button(hgeResMan, 0.2f, "Join Game"), 
		40.0f, 170.0f);
	menu->placeGuiObjectOffset(
		new Button(hgeResMan, 0.2f, "Option"), 
		40.0f, 220.0f);
	menu->placeGuiObjectOffset(
		new Button(hgeResMan, 0.2f, "Exit", 
			new SEvent<MainMenuScene>(this, &MainMenuScene::setSceneEnd)
		),
		40.0f, 270.0f);
	menu->addToGui(sceneManager);
	return true;
}

void MainMenuScene::hint()
{
	sceneManager->setNextScene(new CreateScene());
	setSceneEnd();
}

bool MainMenuScene::update(float dt)
{
	return false;
}

bool MainMenuScene::render(float dt)
{
	hge->Gfx_Clear(0xffffffff);
	return false;
}


void MainMenuScene::Enter() 
{
	gui->Enter();
}

void MainMenuScene::Leave() 
{
	gui->Leave();
}
